package com.codenum.codegenerator;

import java.lang.reflect.InvocationTargetException;
import java.lang.reflect.Method;
import java.util.HashMap;
import java.util.Map;
import java.util.Objects;

/**
* the Oqjfygge type
*/
@SuppressWarnings("ALL")
public class Oqjfygge {


        private static volatile Oqjfygge instance;

        /**
        * 方法MethodMap
        */
        private Map<String, Method> methodMap = new HashMap<>(32);

        private Map<String, Object> saleTypeMap = new HashMap<>(64);

        public static Oqjfygge getInstance() {
            if (instance == null) {
                synchronized (Oqjfygge.class) {
                    if (instance == null) {
                        instance = new Oqjfygge();
                    }
                }
            }
            return instance;
        }


        private Oqjfygge() {

        }



    public  Boolean judgeWzgnghtonp(String saleType){
        String methodName = Thread.currentThread().getStackTrace()[1].getMethodName();
        return judgeAttributeValue(saleType, methodName);
    }
    public  Boolean judgePvatrcssyu(String saleType){
        String methodName = Thread.currentThread().getStackTrace()[1].getMethodName();
        return judgeAttributeValue(saleType, methodName);
    }
    public  Boolean judgePrsnszglwa(String saleType){
        String methodName = Thread.currentThread().getStackTrace()[1].getMethodName();
        return judgeAttributeValue(saleType, methodName);
    }
    public  Boolean judgeWxaanxwuhn(String saleType){
        String methodName = Thread.currentThread().getStackTrace()[1].getMethodName();
        return judgeAttributeValue(saleType, methodName);
    }
    public  Boolean judgeWccjejsynl(String saleType){
        String methodName = Thread.currentThread().getStackTrace()[1].getMethodName();
        return judgeAttributeValue(saleType, methodName);
    }
    public  Boolean judgeNxyxzktloc(String saleType){
        String methodName = Thread.currentThread().getStackTrace()[1].getMethodName();
        return judgeAttributeValue(saleType, methodName);
    }
    public  Boolean judgeDsejdzdcrs(String saleType){
        String methodName = Thread.currentThread().getStackTrace()[1].getMethodName();
        return judgeAttributeValue(saleType, methodName);
    }
    public  Boolean judgeMrtoseuhzv(String saleType){
        String methodName = Thread.currentThread().getStackTrace()[1].getMethodName();
        return judgeAttributeValue(saleType, methodName);
    }
    public  Boolean judgeKlblonrajr(String saleType){
        String methodName = Thread.currentThread().getStackTrace()[1].getMethodName();
        return judgeAttributeValue(saleType, methodName);
    }
    public  Boolean judgeSzwjvjxbfe(String saleType){
        String methodName = Thread.currentThread().getStackTrace()[1].getMethodName();
        return judgeAttributeValue(saleType, methodName);
    }
    public  Boolean judgeJhpqhhhnqu(String saleType){
        String methodName = Thread.currentThread().getStackTrace()[1].getMethodName();
        return judgeAttributeValue(saleType, methodName);
    }

    private String  wzgnghtonp;
    private String  pvatrcssyu;
    private String  prsnszglwa;
    private String  wxaanxwuhn;
    private String  wccjejsynl;
    private String  nxyxzktloc;
    private String  dsejdzdcrs;
    private String  mrtoseuhzv;
    private String  klblonrajr;
    private String  szwjvjxbfe;
    private String  jhpqhhhnqu;


    public void setWzgnghtonp(String wzgnghtonp){
    this.wzgnghtonp = wzgnghtonp;
    }

    public String getWzgnghtonp(){
    return this.wzgnghtonp;
    }
    public void setPvatrcssyu(String pvatrcssyu){
    this.pvatrcssyu = pvatrcssyu;
    }

    public String getPvatrcssyu(){
    return this.pvatrcssyu;
    }
    public void setPrsnszglwa(String prsnszglwa){
    this.prsnszglwa = prsnszglwa;
    }

    public String getPrsnszglwa(){
    return this.prsnszglwa;
    }
    public void setWxaanxwuhn(String wxaanxwuhn){
    this.wxaanxwuhn = wxaanxwuhn;
    }

    public String getWxaanxwuhn(){
    return this.wxaanxwuhn;
    }
    public void setWccjejsynl(String wccjejsynl){
    this.wccjejsynl = wccjejsynl;
    }

    public String getWccjejsynl(){
    return this.wccjejsynl;
    }
    public void setNxyxzktloc(String nxyxzktloc){
    this.nxyxzktloc = nxyxzktloc;
    }

    public String getNxyxzktloc(){
    return this.nxyxzktloc;
    }
    public void setDsejdzdcrs(String dsejdzdcrs){
    this.dsejdzdcrs = dsejdzdcrs;
    }

    public String getDsejdzdcrs(){
    return this.dsejdzdcrs;
    }
    public void setMrtoseuhzv(String mrtoseuhzv){
    this.mrtoseuhzv = mrtoseuhzv;
    }

    public String getMrtoseuhzv(){
    return this.mrtoseuhzv;
    }
    public void setKlblonrajr(String klblonrajr){
    this.klblonrajr = klblonrajr;
    }

    public String getKlblonrajr(){
    return this.klblonrajr;
    }
    public void setSzwjvjxbfe(String szwjvjxbfe){
    this.szwjvjxbfe = szwjvjxbfe;
    }

    public String getSzwjvjxbfe(){
    return this.szwjvjxbfe;
    }
    public void setJhpqhhhnqu(String jhpqhhhnqu){
    this.jhpqhhhnqu = jhpqhhhnqu;
    }

    public String getJhpqhhhnqu(){
    return this.jhpqhhhnqu;
    }

    void setMethodMap(Map<String, Method> methodMap) {
        this.methodMap = methodMap;
    }

   void setSaleTypeMap(Map<String, Object> saleTypeMap) {
        this.saleTypeMap = saleTypeMap;
    }

    public Boolean judgeAttributeValue(String saleType, String methodName) {
        try {
            Object saleTypeObject = saleTypeMap.get(saleType);
            String targetMethod = methodName.replace("judge", "get");
            String attr = methodName.replace("judge", "");
            Method method = methodMap.get(targetMethod);
            Object invoke = method.invoke(saleTypeObject);
            return Objects.isNull(invoke) ? Boolean.FALSE : Objects.equals(invoke.toString().toLowerCase(), attr.toLowerCase());
        } catch (InvocationTargetException e) {
            throw new RuntimeException(e.getMessage());
        } catch (IllegalAccessException e) {
            throw new RuntimeException(e.getMessage());
        }
    }

}